package org.scohen.juploadr;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Properties;

public class PropsCompare {
    
    public PropsCompare(String f1, String f2) throws FileNotFoundException, IOException {
        Properties p1 = new Properties();
        Properties p2 = new Properties();
        p1.load(new FileInputStream(new File(f1)));
        p2.load(new FileInputStream(new File(f2)));
        
        
        Enumeration keys = p1.keys();
        while(keys.hasMoreElements()) {
            String key = (String) keys.nextElement();
            if ( ! p2.containsKey(key)) {
                System.out.println(key);
            } else if ( p2.get(key).equals(p1.get(key))) {
                System.out.println("Warning: same value (" + p1.get(key) + ") for key " + key );
            }
        }
    }
    
    
    
    public static void main(String[] args) throws FileNotFoundException, IOException {
        PropsCompare pc = new PropsCompare(args[0],args[1]);
    }
}
